var map = new BMap.Map("allmap");
var point = new BMap.Point(116.391051,39.992987);
map.centerAndZoom(point, 11);
var marker = new BMap.Marker(point);  // 创建标注
	
var top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角，添加比例尺
var top_left_navigation = new BMap.NavigationControl();  //左上角，添加默认缩放平移控件
var top_right_navigation = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}); //右上角，仅包含平移和缩放按钮
$(function(){
	// 百度地图API功能
	
	map.addOverlay(marker);
	var label = new BMap.Label("北京市北四环中路6号健翔桥东华亭嘉园D座3F",{offset:new BMap.Size(-117,30)});
	label.setStyle({
			 color : "#fff",
			 background: "red",
			 padding:"0 10px",
			 fontSize : "12px",
			 height : "20px",
			 lineHeight : "20px",
			 fontFamily:"微软雅黑"
		 });
	marker.setLabel(label);

	/*缩放控件type有四种类型:
	BMAP_NAVIGATION_CONTROL_SMALL：仅包含平移和缩放按钮；BMAP_NAVIGATION_CONTROL_PAN:仅包含平移按钮；BMAP_NAVIGATION_CONTROL_ZOOM：仅包含缩放按钮*/
	add_control();
	map.addEventListener("zoomend", function(e) { 
		map.panTo(point);
	});
});
//添加控件和比例尺
	function add_control(){
		map.addControl(top_left_control);        
		map.addControl(top_left_navigation);     
		map.addControl(top_right_navigation);    
	}
	//移除控件和比例尺
	// function delete_control(){
	// 	map.removeControl(top_left_control);     
	// 	map.removeControl(top_left_navigation);  
	// 	map.removeControl(top_right_navigation); 
	// }
    